package pl.softech.gpw.model;

import java.util.Collection;

public class FIHelper {

    public static double[] toLow(Collection<FInstrument> fis) {
        double[] ret = new double[fis.size()];
        
        int i = 0;
        for(FInstrument fi :fis) {
            ret[i++] = fi.getLow();
        }
        return ret;
    }
    
    public static double[] toHigh(Collection<FInstrument> fis) {
        double[] ret = new double[fis.size()];
        
        int i = 0;
        for(FInstrument fi :fis) {
            ret[i++] = fi.getHigh();
        }
        return ret;
    }
    
    public static double[] toClose(Collection<FInstrument> fis) {
        double[] ret = new double[fis.size()];
        
        int i = 0;
        for(FInstrument fi :fis) {
            ret[i++] = fi.getClose();
        }
        return ret;
    }
    
}
